package com.digua.base.base

import androidx.viewpager.widget.ViewPager.OnPageChangeListener

class BaseOnPageChangeListener : OnPageChangeListener {
    private var lambda: ((position: Int) -> Unit)? = null

    constructor(lambda: (position: Int) -> Unit) {
        this.lambda = lambda
    }

    override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
    }

    override fun onPageSelected(position: Int) {
        lambda?.let { it(position) }
    }

    override fun onPageScrollStateChanged(state: Int) {
    }
}